const { defineConfig } = require('@vue/cli-service')
const pxtorem = require('postcss-pxtorem')

module.exports = defineConfig({
  transpileDependencies: true,
  css: {
    loaderOptions: {
      postcss: {
        postcssOptions: {
          plugins: [
            pxtorem({
              rootValue: 75,
              propList: ['*', '!font*'],
              selectorBlackList: ['van'],
            }),
          ],
        },
      },
    },
  },
  devServer: { // 配置webpack-dev-server 服务器相关
    host: 'localhost', // 默认打开位置
    open: true,
    proxy: {
      '/guazi': {
        target: 'https://mapi.guazi.com',
        changeOrigin: true, // 若后端未解决跨域可用此方法解决
        pathRewrite: { // 修改路径 把多余的guazi去掉
          '^/guazi': '',
        },
      },
    },
  },
})
